<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="functions.asp" --> 
<%
set UC = Server.CreateObject("ADODB.Recordset")
UC.ActiveConnection = cn
UC.Source = "SELECT *  FROM dbo.EXIUSERCOORD WHERE EMPCODE IN (SELECT EMPCODE FROM EMP WHERE EMPSTA='OPEN') ORDER BY EMPCODE "
'UC.CursorType = 0
'UC.CursorLocation = 2
'UC.LockType = 3
UC.Open()
UC_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
UC_numRows = UC_numRows + Repeat1__numRows
%>

<SCRIPT Language="JavaScript">
function DocLoad(){

}

</SCRIPT>
<!--#include file="PageTop.asp" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#93bee2">
  <tr> 
    <td width="8%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td width="8%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td width="8%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF"><img src="images/curv_data.gif" width="21" height="21"></td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr> 
    <td width="8%">&nbsp;</td>
    <td width="2%" bgcolor="#0000CC"> 
      <script language="JavaScript">	  
function addRow(id){
			
var rows = Number(document.form1.Incr.value);
var tbody = document.getElementById(id).getElementsByTagName("TBODY")[0];

var row = document.createElement("TR");
row.setAttribute("bgColor","#FFFFFF");

//create hidden field box
var hf1 = document.createElement("INPUT");
hf1.setAttribute("type","hidden");
hf1.setAttribute("name","seqnum" + rows);
hf1.setAttribute("value","0"); 
         
//create input box
var ip1 = document.createElement("INPUT");
ip1.setAttribute("TYPE","TEXT");
ip1.setAttribute("name","empcode" + rows);
ip1.setAttribute("id","empcode" + rows);
ip1.setAttribute("size","12");

var bt1=document.createElement("INPUT");
bt1.setAttribute("type","button");
bt1.setAttribute("value"," ... ");
bt1.onclick=function(){openpopup('EmpList.asp?fName=form1.empcode'+rows+'&fName2=form1.fname'+rows+'&fName3=form1.dept'+rows)};

var ip3 = document.createElement("INPUT");
ip3.setAttribute("TYPE","TEXT");
ip3.setAttribute("name","dept" + rows);
ip3.setAttribute("id","dept" + rows);
ip3.setAttribute("size","15");
//ip3.setAttribute("className","InputBoxCopy");

var ip4 = document.createElement("INPUT");
ip4.setAttribute("TYPE","TEXT");
ip4.setAttribute("name","fname" + rows);
ip4.setAttribute("id","fname" + rows);
ip4.setAttribute("size","35");

var ip5 = document.createElement("INPUT");
ip5.setAttribute("TYPE","TEXT");
ip5.setAttribute("name","fdefault" + rows);
ip5.setAttribute("id","fdefault" + rows);
ip5.setAttribute("size","5");

//create column
var td1 = document.createElement("TD");
td1.setAttribute("bgcolor","#ffffff");
td1.setAttribute("align","right");
td1.appendChild(document.createTextNode(rows+"."));

var td2 = document.createElement("TD");
td2.setAttribute("align","center");
td2.appendChild(document.getElementById("form1").appendChild(hf1));
			
//td2.appendChild(document.createTextNode("column 2"));
var td3 = document.createElement("TD");
td3.setAttribute("align","left");
td3.appendChild(document.getElementById("form1").appendChild(ip1));
td3.appendChild(document.getElementById("form1").appendChild(bt1));

var td5 = document.createElement("TD");
td5.setAttribute("align","left");
td5.appendChild(document.getElementById("form1").appendChild(ip3));

var td6 = document.createElement("TD");
td6.setAttribute("align","left");
td6.appendChild(document.getElementById("form1").appendChild(ip4));

var td7 = document.createElement("TD");
td7.setAttribute("align","left");
td7.appendChild(document.getElementById("form1").appendChild(ip5));
            
row.appendChild(td1);
row.appendChild(td2);
row.appendChild(td3);

row.appendChild(td5);
row.appendChild(td6);
row.appendChild(td7);
tbody.appendChild(row);
document.form1.Incr.value = rows + 1;

return
}
</script>    </td>
    <td bgcolor="#FFFFFF"> 
      <form name="form1" method="post" action="Adm_UC_proc.asp">
        <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#999999" id="UC_Table">
          <tr> 
            <td width="5%" bgcolor="#dde7ff"> 
              <div align="center"><b>No</b></div>            </td>
            <td bgcolor="#dde7ff" width="10%"> 
              <div align="center"><b>Active</b></div>            </td>
            <td bgcolor="#dde7ff" width="15%"> 
              <div align="center"><b>Emp. Code</b></div>            </td>
            <td bgcolor="#dde7ff" width="15%"> 
              <div align="center"><b>Department</b></div>            </td>
            <td bgcolor="#dde7ff"> 
              <div align="center"><b>Full Name</b></div>            </td>
			<td bgcolor="#dde7ff"> 
              <div align="center"><b>Default</b></div>            </td>
          </tr>
          <% dim incr
		  incr=1 %>
          <% 
While ((Repeat1__numRows <> 0) AND (NOT UC.EOF)) 
%>
          <tr bgcolor="#FFFFFF"> 
            <td width="5%" 
<% if (UC.Fields.Item("ISDELETED").Value="Y") then 
     response.write "style='color:aaaaaa;'" 
   else
     response.write "style='color:000000;'" 
   end if
%>> 
              <div align="right"><%= incr %>.</div>            </td>
            <td bgcolor="#FFFFFF" width="10%"> 
              <div align="center"> 
                <input type="hidden" name="seqnum<%= incr %>" value="<%=(UC.Fields.Item("SEQNUM").Value)%>">
                <input type="checkbox" name="cb<%= incr %>" value="N" <% if (UC.Fields.Item("ISDELETED").Value<>"Y") then response.write "checked" %>>
              </div>            </td>
            <td width="15%"> 
              <div align="left"><b> 
                <input type="text" name="empcode<%= incr %>" class="InputBoxCopy" size="12" maxlength="12" value="<%=(UC.Fields.Item("EMPCODE").Value)%>" 
	<% if (UC.Fields.Item("ISDELETED").Value="Y") then 
     response.write "style='color:aaaaaa;'" 
   else
     response.write "style='color:000000;'" 
   end if
%>>
                </b></div>            </td>
            <td width="15%"> 
              <input type="text" name="dept<%= incr %>" value="<%=(UC.Fields.Item("DEPARTMENT").Value)%>" class="InputBoxCopy" size="15" maxlength="15"
<% if (UC.Fields.Item("ISDELETED").Value="Y") then 
     response.write "style='color:aaaaaa;'" 
   else
     response.write "style='color:000000;'" 
   end if
%>>            </td>
            <td> 
              <input type="text" name="fname<%= incr%>" value="<%=(UC.Fields.Item("FULLNAME").Value)%>" class="InputBoxCopy" size="35" maxlength="50"
<% if (UC.Fields.Item("ISDELETED").Value="Y") then 
     response.write "style='color:aaaaaa;'" 
   else
     response.write "style='color:000000;'" 
   end if
%>>            </td>
			<td> 
              <input type="text" name="fdefault<%= incr%>" value="<%=(UC.Fields.Item("ISDEFAULT").Value)%>" class="InputBoxCopy" size="5" maxlength="50"
<% if (UC.Fields.Item("ISDELETED").Value="Y") then 
     response.write "style='color:aaaaaa;'" 
   else
     response.write "style='color:000000;'" 
   end if
%>>            </td>
          </tr>
          <% incr = incr + 1
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  UC.MoveNext()
Wend
%>
        </table>
        <table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#999999">
          <tr bgcolor="#FFFFFF"> 
            <td> 
              <input type="hidden" name="Incr" value="<%= Incr %>">
              <input type="button" name="Submit2" value="Add User Coordinator" class="sbttn" onClick="addRow('UC_Table')">

            </td>
          </tr>
        </table>
        <p> 
          <input type="submit" name="Submit" value=" Update Table " class="sbttn">
        </p>
      </form>
    </td>
  </tr>
  <tr> 
    <td width="8%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
UC.Close()
%>
